<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="">
username:<input name="username" type="text" onmouseover="test1()" onmouseout="test2()"><br>
<p id="comment" style="display:none">用户名长度不能大于15个字符</p><br>
pwd:<input name="pwd1" type="password"><br>
repwd:<input name="pwd2" type="password"><br>
<input type="submit" value="submit" onclick="clickhere()" ><br>

</form>
<script type="text/javascript">
//声明变量
var name="这是一个javascript变量";
alert(name);
alert("好喽你好！");
// js的方法定义格式  function clickhere(){}
function clickhere(){
	alert("你点击了提交按钮！！");
	comparepwd("密码123");
	var rs=add(11,23);
	alert(rs);
	}
function comparepwd(pwd){
	alert("这里是comparepwd"+pwd)

}
//有返回值的js方法
function add(v1,v2){
	return v1+v2;
}
function test2(){
	document.getElementById("comment").style.display="none";
} 
function test1(){
	document.getElementById("comment").style.display="inline";
}
var jj=['11','22','33'];
 for(var i=0;i<4;i++){
	alert(jj[i]);
} 
</script>
</body>
</html>